Intro
The aim of this project is to teach the fundamentals of building a Python API with OpenApi. The API itself is a pipeline API that uses the Star Wars Data at https://swapi.py4e.com/api/ and pass that through this API to clients. The openAPI enables the use of a Swagger definition and User interface. The definition acting as the definitive APi specification. The minimal use of the Python framework Flask in conjunction with Connexion are used to provide the bridge to our python API endpoints.
In order to complete this project you will need to clone/download the project from Github at StarWars API Learning Project
The project framework (.py) files on the repository are empty save for a couple of database configuration declarations in the config.v1.app_config.py file.
Apart from the base structure, there are several markdown files under training-docs and some setup files in the root. These documents are the same as you will see here and take the user through the setup and build process of the project step by step with explanations of the code.
The user is expected to copy and paste the code, by either following this version of the tutorial or the documents under training-docs on the GitHub repository. For setup information you should follow the instructions in the readme in the repository root directory.
The build process describes in detail all aspects of the project code-base without being over cumbersome. There is no time specification for building the project. More important than time is the understanding of the project architecture and what is going on in the code itself.
Before building this project the student must have at least a beginners understanding of Python, OpenAPI and APIs in general. An understanding of the http protocol is recommended. It is recommended that you study the "Developing for the Internet" course completely at Developing for the Internet. This course will provide you with the necessary knowledge to understand the technical aspects of this project.
Notes for those starting to learn about Software Development. Sometimes it feels impossible, sometimes it feels that there is too much to learn. Don't let these feelings stop you. You will have many breakthrough moments that will encourage you and provide a sense of achievement. Continue learning, it's what life is all about.
Notes for all those existing Python gurus. If you have any constructive comments and recommendations we would love to hear about them. The completed project without the learning tutorials is available on GitHub at StarWars API. To provide feedback on this course or contact us at Fathat.org, drop us a line at hello@fathat.org
Backend API Learning Workflow:
Before you build the API start with the Project Structure to get a good understanding of where everything is and how the project is laid out.
Project Structure:
Building Our API
- Stage 1 - API Foundation - app, endpoint - API specification
- Stage 2 - Extending the API - external API access, data access layer, filtering options, error handling, another endpoint
- Stage 3 - Go it alone - Exercise
- Stage 4 - Adding Authentication
- Stage 5 - Introducing Users
- Stage 6 - Introducing Testing
- Stage 7 - Deploying our backend